package test4.withLock;

public class AppLock {
    public static void main(String[] args) {
        Account a = new Account(1, "A", 5);
        Account b = new Account(2, "B", 5);

        Thread thread1 = new Thread(() -> a.transferTo(b, 1));
        Thread thread2 = new Thread(() -> b.transferTo(a, 1));

        thread1.start();
        thread2.start();
    }
}
